﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Script.Net.Scripts;


namespace Script.Net.Mvc
{
	public static class ScriptExtensions
	{
		public static IHtmlString Script(this HtmlHelper html, string alias, Func<object, IHtmlString> template)
		{
			return Script(html, alias, null, template);
		}

		public static IHtmlString Script(this HtmlHelper html, string alias, IEnumerable<string> dependsOnAliases, Func<object, IHtmlString> template)
		{
			ScriptFactory.Repository.CreateScript(new ScriptContent { Alias = alias, Dependencies = dependsOnAliases, Content = template(null) });

			return new MvcHtmlString("");
		}
	}
}
